programming4us
           
 
 
SQL Server

Encryption basics for SQL Server : Key Maintenance

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
10/24/2010 4:46:09 PM
Cryptographic keys and passwords that protect keys are not a "set-it-and-forgetit" feature of securing sensitive data; they require periodic maintenance to ensure that the items that are protected remain at their highest level of security. Regular maintenance of keys and passwords reduces the occurrences of the patterns of encryption being discovered through the monitoring of encrypted values, a practice called crypto-analysis. It reduces the occurrences of key fatigue, in which bits of plain text begin to appear among the cipher text. In the unfortunate situation when a key is revealed, improperly disclosed or lost, the scope of the compromised data is reduced if the entire body of sensitive data is not protected with the same key.

This maintenance is handled by shepherding each key through a lifecycle, illustrated in Figure 1, which defines when a key is created, used for the first time in encryption and decryption, expired for encryption purposes, retired from use and finally eliminated.

Figure 1. Key Lifecycle.

Other than providing a means to create new keys and regenerate encrypted data with a new key, SQL Server does not offer a built-in means to manage keys through this lifecycle. At first glance, this may seem to be a bad oversight but, in fact, provision of key management functionality within the database that contains the encrypted data and keys introduces a potential vulnerability in data security.

Extensible Key Management (SQL Server 2008)

To address the maintenance issue, SQL Server 2008 introduced functionality called Extensible Key Management (EKM). Through the Microsoft Cryptographic API (MCAPI) provider, this feature offers the ability to implement a third party solution, or even a custom built solution, for generating, backing up, exporting, distributing, retrieving keys and managing the overall key lifecycle externally from the database. EKM also enables use of devices such as Hardware Security Modules (HSM), smartcards, and fingerprint readers to store, configure and manage key lifecycles.

MCAPI cryptographic providers can be created in SQL Server through the execution of the CREATE CRYPTOGRAPHIC PROVIDER command, as shown in Listing 1. The .dll file provided in this example represents a third party product that would be used for key management functionality.

Listing 1. Creating a cryptographic provider in SQL Server.

You can query sys.cryptographic_providers to verify that the provider was successfully created.

The use of EKM, by default, is disabled. To begin to use this feature of SQL Server you will need to first execute the script in Listing 2.

Listing 2. Enabling EKM.

Once the cryptographic providers have been created and EKM is enabled these keys can be utilized to perform encryption and decryption of other keys and data through the standard built-in cryptographic functions that are provided with SQL Server.

Backing up Keys

Whenever the topic of encryption is being discussed there is a question that inevitably arises. This question is in regard to how encrypted data can be recovered if the key is lost or corrupted. The answer is a short one: the data will be lost. That is unless you have backed up all of the keys that are used in the encryption effort.

When the database is backed up through the built-in SQL Server database back up process, some keys are included in the back up file and others are not. The asymmetric keys and symmetric keys that are created within the database, as well as the database encryption key that is used in the TDE feature, are all included in the database backup. The service master key, database master key and certificates are not included in the database backup. Each of these keys must be backed up as a separate task, using the following commands:

  • BACKUP SERVICE MASTER KEY

  • BACKUP MASTER KEY

  • BACKUP CERTIFICATE

Each of these commands contains an ENCRYPTED BY PASSWORD option which protects the backup files with the defined password, as shown in Listing 3.

To recover these keys, knowledge of this password is required.

Listing 3. Backing up the service master key, database master key and certificate.

It is highly recommended that these key backup files are stored on separate media from the database backup files so that, in the event that the media that contains the database backup files is stolen or compromised, the data contained within the database remains secured. The decryption of the data and files contained in the backup media would require access to the backup media that contained the key backup files.

Other -----------------
- Encryption basics for SQL Server : Key Algorithms
- SQL Server 2005 : Performing Database Backups
- SQL Server 2005 : Restoring Data from a Backup
- SQL Server 2005 : Using Database Snapshots
- SQL Server 2005 : Automating Maintenance with Job Scheduling
- Other SQL Server XML Support
- SQL Server 2005 : Managing XML Data (part 2) - The xml Data Type and Methods
- SQL Server 2005 : Managing XML Data (part 1)
- SQL Server : Removing Unwanted Data
- SQL Server : Changing What Is Already Stored
- Using System Tables and Views
- SQL Server 2005 : Data Querying Using Full-Text Indexes
- SQL Dependency Reporting
- The Overall Disaster Recovery Process
- Microsoft SQL Server Options for Disaster Recovery
- How to Approach Disaster Recovery
- SQL Server 2008 : Database Mirroring
- Creating and Using a SQL Azure Database
- SQL Server 2008 : Failover Clustering
- SQL Server 2008 Reporting Services : Management and Security
 
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
- First look: Apple Watch

- 3 Tips for Maintaining Your Cell Phone Battery (part 1)

- 3 Tips for Maintaining Your Cell Phone Battery (part 2)
programming4us programming4us